<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>可约时间</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
	<c:set var="ctx" value="${pageContext.request.contextPath}" />
    <link rel="stylesheet" href="${ctx}/assets/css/amazeui.min.css">
    <link rel="stylesheet" href="${ctx}/assets/css/style.css?v=2.3">
    <link rel="stylesheet" href="${ctx}/assets/css/index.css?v=2.3">
    <script src="${ctx}/assets/js/myAlert.js"></script>
    <script>
    	var counsTels='${counseTel}';
    	if(counsTels==""){
    		myAlert("咨询师登录超时");
    		location.href="business/login.jsp";
    	}
    </script>
</head>
<body class="">
<header data-am-widget="header" class="am-header am-header-default am-header-fixed am-border-bottom">
    <div class="am-header-left am-header-nav">
        <a onclick="history.go(-1)">  <i class="icon_8"></i>
        </a>
    </div>
    <h1 class="am-header-title">
        可约时间
    </h1>

</header>
<section class="am-padding-bottom-sm" id="amz-main" data-tag="css-nav">
	<c:if test="${xingqi==1}">
	  <div id="wrapper" class="link-list am-margin-top-sm">
        <div id="scroller" class="select-day">
            <ul id="thelist">
            	<li class="current" onclick="gotoCanYuyue(1)"><div>周一</div><div class="font-12">${d1}</div></li>
                 <li onclick="gotoCanYuyue(2)"><div>周二</div><div class="font-12">${d2}</div></li>
                 <li onclick="gotoCanYuyue(3)"><div>周三</div><div class="font-12">${d3}</div></li>
                 <li onclick="gotoCanYuyue(4)"><div>周四</div><div class="font-12">${d4}</div></li>
                 <li onclick="gotoCanYuyue(5)"><div>周五</div><div class="font-12">${d5}</div></li>
                 <li onclick="gotoCanYuyue(6)"><div>周六</div><div class="font-12">${d6}</div></li>
                 <li onclick="gotoCanYuyue(7)"><div>周日</div><div class="font-12">${d7}</div></li>
                 
            </ul>
        </div>
    </div>
	</c:if>
	<c:if test="${xingqi==2}">
	  <div id="wrapper" class="link-list am-margin-top-sm">
        <div id="scroller" class="select-day">
            <ul id="thelist">
                 <li class="current" onclick="gotoCanYuyue(2)"><div>周二</div><div class="font-12">${d1}</div></li>
                 <li onclick="gotoCanYuyue(3)"><div>周三</div><div class="font-12">${d2}</div></li>
                 <li onclick="gotoCanYuyue(4)"><div>周四</div><div class="font-12">${d3}</div></li>
                 <li onclick="gotoCanYuyue(5)"><div>周五</div><div class="font-12">${d4}</div></li>
                 <li onclick="gotoCanYuyue(6)"><div>周六</div><div class="font-12">${d5}</div></li>
                 <li onclick="gotoCanYuyue(7)"><div>周日</div><div class="font-12">${d6}</div></li>
                 <li onclick="gotoCanYuyue(1)"><div>周一</div><div class="font-12">${d7}</div></li>
            </ul>
        </div>
    </div>
	</c:if>
	<c:if test="${xingqi==3}">
	  <div id="wrapper" class="link-list am-margin-top-sm">
        <div id="scroller" class="select-day">
            <ul id="thelist">
                 <li class="current" onclick="gotoCanYuyue(3)"><div>周三</div><div class="font-12">${d1}</div></li>
                 <li onclick="gotoCanYuyue(4)"><div>周四</div><div class="font-12">${d2}</div></li>
                 <li onclick="gotoCanYuyue(5)"><div>周五</div><div class="font-12">${d3}</div></li>
                 <li onclick="gotoCanYuyue(6)"><div>周六</div><div class="font-12">${d4}</div></li>
                 <li onclick="gotoCanYuyue(7)"><div>周日</div><div class="font-12">${d5}</div></li>
                 <li onclick="gotoCanYuyue(1)"><div>周一</div><div class="font-12">${d6}</div></li>
                 <li onclick="gotoCanYuyue(2)"><div>周二</div><div class="font-12">${d7}</div></li>
            </ul>
        </div>
    </div>
	</c:if>
	<c:if test="${xingqi==4}">
	  <div id="wrapper" class="link-list am-margin-top-sm">
        <div id="scroller" class="select-day">
            <ul id="thelist">
                 <li  class="current" onclick="gotoCanYuyue(4)"><div>周四</div><div class="font-12">${d1}</div></li>
                 <li onclick="gotoCanYuyue(5)"><div>周五</div><div class="font-12">${d2}</div></li>
                 <li onclick="gotoCanYuyue(6)"><div>周六</div><div class="font-12">${d3}</div></li>
                 <li onclick="gotoCanYuyue(7)"><div>周日</div><div class="font-12">${d4}</div></li>
                 <li onclick="gotoCanYuyue(1)"><div>周一</div><div class="font-12">${d5}</div></li>
                 <li onclick="gotoCanYuyue(2)"><div>周二</div><div class="font-12">${d6}</div></li>
                 <li onclick="gotoCanYuyue(3)"><div>周三</div><div class="font-12">${d7}</div></li>
            </ul>
        </div>
    </div>
	</c:if>
	<c:if test="${xingqi==5}">
	  <div id="wrapper" class="link-list am-margin-top-sm">
        <div id="scroller" class="select-day">
            <ul id="thelist">
                <li class="current" onclick="gotoCanYuyue(5)"><div>周五</div><div class="font-12">${d1}</div></li>
                 <li onclick="gotoCanYuyue(6)"><div>周六</div><div class="font-12">${d2}</div></li>
                 <li onclick="gotoCanYuyue(7)"><div>周日</div><div class="font-12">${d3}</div></li>
                 <li onclick="gotoCanYuyue(1)"><div>周一</div><div class="font-12">${d4}</div></li>
                 <li onclick="gotoCanYuyue(2)"><div>周二</div><div class="font-12">${d5}</div></li>
                 <li onclick="gotoCanYuyue(3)"><div>周三</div><div class="font-12">${d6}</div></li>
                 <li onclick="gotoCanYuyue(4)"><div>周四</div><div class="font-12">${d7}</div></li>
            </ul>
        </div>
    </div>
	</c:if>
	<c:if test="${xingqi==6}">
	  <div id="wrapper" class="link-list am-margin-top-sm">
        <div id="scroller" class="select-day">
            <ul id="thelist">
                 <li  class="current" onclick="gotoCanYuyue(6)"><div>周六</div><div class="font-12">${d1}</div></li>
                 <li onclick="gotoCanYuyue(7)"><div>周日</div><div class="font-12">${d2}</div></li>
                 <li onclick="gotoCanYuyue(1)"><div>周一</div><div class="font-12">${d3}</div></li>
                 <li onclick="gotoCanYuyue(2)"><div>周二</div><div class="font-12">${d4}</div></li>
                 <li onclick="gotoCanYuyue(3)"><div>周三</div><div class="font-12">${d5}</div></li>
                 <li onclick="gotoCanYuyue(4)"><div>周四</div><div class="font-12">${d6}</div></li>
                 <li onclick="gotoCanYuyue(5)"><div>周五</div><div class="font-12">${d7}</div></li>
            </ul>
        </div>
    </div>
	</c:if>
	<c:if test="${xingqi==7}">
	  <div id="wrapper" class="link-list am-margin-top-sm">
        <div id="scroller" class="select-day">
            <ul id="thelist">
                 <li  class="current" onclick="gotoCanYuyue(7)"><div>周日</div><div class="font-12">${d1}</div></li>
                 <li onclick="gotoCanYuyue(1)"><div>周一</div><div class="font-12">${d2}</div></li>
                 <li onclick="gotoCanYuyue(2)"><div>周二</div><div class="font-12">${d3}</div></li>
                 <li onclick="gotoCanYuyue(3)"><div>周三</div><div class="font-12">${d4}</div></li>
                 <li onclick="gotoCanYuyue(4)"><div>周四</div><div class="font-12">${d5}</div></li>
                 <li onclick="gotoCanYuyue(5)"><div>周五</div><div class="font-12">${d6}</div></li>
                 <li onclick="gotoCanYuyue(6)"><div>周六</div><div class="font-12">${d7}</div></li>
            </ul>
        </div>
    </div>
	</c:if>
	<div class="icon_26 am-text-center font-color-12 am-margin-top-sm">
        选择可约时间
    </div>
    <div class="am-g  bg-white    font-14  am-text-center select-times am-margin-top-xs">
        <div class="select-time am-padding-left-sm">
            <c:if test="${c08==08}">
            <div class="am-u-sm-3 cur">
                <div class="btn-time">08:00</div>
            </div>
            </c:if>
            <c:if test="${c08!=08}">
            <div class="am-u-sm-3">
                <div class="btn-time">08:00</div>
            </div>
            </c:if>
             <c:if test="${c09==09}">
            <div class="am-u-sm-3 cur">
                <div class="btn-time">09:00</div>
            </div>
            </c:if>
            <c:if test="${c09!=09}">
            <div class="am-u-sm-3">
                <div class="btn-time">09:00</div>
            </div>
            </c:if>
             <c:if test="${c10==10}">
            <div class="am-u-sm-3 cur">
                <div class="btn-time">10:00</div>
            </div>
            </c:if>
             <c:if test="${c10!=10}">
            <div class="am-u-sm-3">
                <div class="btn-time">10:00</div>
            </div>
            </c:if>
             <c:if test="${c11==11}">
            <div class="am-u-sm-3 cur">
                <div class="btn-time">11:00</div>
            </div>
            </c:if>
             <c:if test="${c11!=11}">
            <div class="am-u-sm-3">
                <div class="btn-time">11:00</div>
            </div>
            </c:if>
             <c:if test="${c12==12}">
            <div class="am-u-sm-3 cur">
                <div class="btn-time">12:00</div>
            </div>
            </c:if>
             <c:if test="${c12!=12}">
            <div class="am-u-sm-3">
                <div class="btn-time">12:00</div>
            </div>
            </c:if>
             <c:if test="${c13==13}">
            <div class="am-u-sm-3 cur">
                <div class="btn-time">13:00</div>
            </div>
            </c:if>
             <c:if test="${c13!=13}">
            <div class="am-u-sm-3">
                <div class="btn-time">13:00</div>
            </div>
            </c:if>
             <c:if test="${c14==14}">
           <div class="am-u-sm-3 cur">
                <div class="btn-time">14:00</div>
            </div>
            </c:if>
             <c:if test="${c14!=14}">
           <div class="am-u-sm-3">
                <div class="btn-time">14:00</div>
            </div>
            </c:if>
             <c:if test="${c15==15}">
            <div class="am-u-sm-3 cur">
                <div class="btn-time">15:00</div>
            </div>
            </c:if>
             <c:if test="${c15!=15}">
            <div class="am-u-sm-3">
                <div class="btn-time">15:00</div>
            </div>
            </c:if>
 			<c:if test="${c16==16}">
            <div class="am-u-sm-3 cur">
                <div class="btn-time">16:00</div>
            </div>
            </c:if>
 			<c:if test="${c16!=16}">
            <div class="am-u-sm-3">
                <div class="btn-time">16:00</div>
            </div>
            </c:if>
             <c:if test="${c17==17}">
           <div class="am-u-sm-3 cur">
                <div class="btn-time">17:00</div>
            </div>
            </c:if>
             <c:if test="${c17!=17}">
           <div class="am-u-sm-3">
                <div class="btn-time">17:00</div>
            </div>
            </c:if>
             <c:if test="${c18==18}">
            <div class="am-u-sm-3 cur">
                <div class="btn-time">18:00</div>
            </div>
            </c:if>
             <c:if test="${c18!=18}">
            <div class="am-u-sm-3">
                <div class="btn-time">18:00</div>
            </div>
            </c:if>
             <c:if test="${c19==19}">
            <div class="am-u-sm-3 cur">
                <div class="btn-time">19:00</div>
            </div>
            </c:if>
             <c:if test="${c19!=19}">
            <div class="am-u-sm-3">
                <div class="btn-time">19:00</div>
            </div>
            </c:if>
 			<c:if test="${c20==20}">
            <div class="am-u-sm-3 cur">
                <div class="btn-time">20:00</div>
            </div>
            </c:if>
 			<c:if test="${c20!=20}">
            <div class="am-u-sm-3">
                <div class="btn-time">20:00</div>
            </div>
            </c:if>
             <c:if test="${c21==21}">
            <div class="am-u-sm-3 cur">
                <div class="btn-time">21:00</div>
            </div>
            </c:if>
             <c:if test="${c21!=21}">
            <div class="am-u-sm-3">
                <div class="btn-time">21:00</div>
            </div>
            </c:if>
            <c:if test="${c22==22}">
            <div class="am-u-sm-3 cur">
                <div class="btn-time">22:00</div>
            </div>
             </c:if>
            <c:if test="${c22!=22}">
            <div class="am-u-sm-3">
                <div class="btn-time">22:00</div>
            </div>
             </c:if>
             <c:if test="${c23==23}">
           <div class="am-u-sm-3 cur">
                <div class="btn-time">23:00</div>
            </div>
             </c:if>
             <c:if test="${c23!=23}">
           <div class="am-u-sm-3">
                <div class="btn-time">23:00</div>
            </div>
             </c:if>
             <c:if test="${c24==24}">
            <div class="am-u-sm-3 cur am-u-end">
                <div class="btn-time">24:00</div>
            </div>
            </c:if>
             <c:if test="${c24!=24}">
            <div class="am-u-sm-3 am-u-end">
                <div class="btn-time">24:00</div>
            </div>
            </c:if>
        </div>
    </div>
    <div class="am-container am-margin-top-lg">
        <div class="btn-4 word-space-2 padding-left-0" id="quedin">确定</div>
    </div>
</section>
<script src="${ctx}/assets/js/jquery.min.js"></script>
<script src="${ctx}/assets/js/amazeui.min.js"></script>
<script src="${ctx}/assets/js/iscroll.js"></script>
<script type="text/javascript">
    var myScroll;
    function loaded() {
        myScroll = new iScroll('wrapper',{
            snap:true,
            vScroll:false,
            hScroll:true,
            hScrollbar:false,
            click:true
        });
    }

    document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);

    document.addEventListener('DOMContentLoaded', loaded, false);

</script>
<script>
	function gotoCanYuyue(xinqi) {
        var flag=confirm("确定要切换日期吗？请先保存本界面");
        if(flag){
        	window.location.href="${ctx}/gotoCanYuyue?xingqi="+xinqi;
        }else{
        	return false;
        }
    };
    // 时间选择
    //$(".select-day li").click(function () {
    //    $(".select-day li").removeClass("current");
    //    $(this).addClass("current");
    //});
    $("#quedin").click(function () {
        var week=$("#scroller").find(".current").text();
        var canTimes=$(".cur").text();
        var totalTime="";
        if(canTimes.indexOf("08:00")>0){
        	totalTime+="08";
        }
        if(canTimes.indexOf("09:00")>0){
        	totalTime+=",09";
        }
        if(canTimes.indexOf("10:00")>0){
        	totalTime+=",10";
        }
        if(canTimes.indexOf("11:00")>0){
        	totalTime+=",11";
        }
        if(canTimes.indexOf("12:00")>0){
        	totalTime+=",12";
        }
        if(canTimes.indexOf("13:00")>0){
        	totalTime+=",13";
        }
        if(canTimes.indexOf("14:00")>0){
        	totalTime+=",14";
        }
        if(canTimes.indexOf("15:00")>0){
        	totalTime+=",15";
        }
        if(canTimes.indexOf("16:00")>0){
        	totalTime+=",16";
        }
        if(canTimes.indexOf("17:00")>0){
        	totalTime+=",17";
        }
        if(canTimes.indexOf("18:00")>0){
        	totalTime+=",18";
        }
        if(canTimes.indexOf("19:00")>0){
        	totalTime+=",19";
        }
        if(canTimes.indexOf("20:00")>0){
        	totalTime+=",20";
        }
        if(canTimes.indexOf("21:00")>0){
        	totalTime+=",21";
        }
        if(canTimes.indexOf("22:00")>0){
        	totalTime+=",22";
        }
        if(canTimes.indexOf("23:00")>0){
        	totalTime+=",23";
        }
        if(canTimes.indexOf("24:00")>0){
        	totalTime+=",24";
        }
        if(week.indexOf("一")>0){
			week="1";
		}
		if(week.indexOf("二")>0){
			week="2";
		}
		if(week.indexOf("三")>0){
			week="3";
		}
		if(week.indexOf("四")>0){
			week="4";
		}
		if(week.indexOf("五")>0){
			week="5";
		}
		if(week.indexOf("六")>0){
			week="6";
		}
		if(week.indexOf("日")>0){
			week="7";
		}
        var yuyueStr=$.ajax({url:"${ctx}/gotoSetCanYuyue?totalTime="+totalTime+"&week="+week,async:false});
        var yuyueJson=JSON.parse(yuyueStr.responseText);
        if(yuyueJson.resultCode=="0"){
        	location.reload(true); 
        }else{
        	myAlert(yuyueJson.resultDesc);
        }
    });
    $(".select-time .am-u-sm-3").click(function () {
        if (!$(this).hasClass("dis")) {
            var $flag=$(this).hasClass("cur");
            if($flag) {
                $(this).removeClass("cur");
            }else{
                $(this).addClass("cur");
            }
        }
    });
</script>
</body>
</html>